package alpha;



/**
 * The test class CalculadoraTest.
 *
 * @author  (your name)
 * @version (a version number or a date)
 */
public class CalculadoraTest extends junit.framework.TestCase
{
	private alpha.Calculadora calculad1;

    /**
     * Default constructor for test class CalculadoraTest
     */
    public CalculadoraTest()
    {
    }

    /**
     * Sets up the test fixture.
     *
     * Called before every test case method.
     */
    protected void setUp()
    {
		calculad1 = new alpha.Calculadora();
	}

    /**
     * Tears down the test fixture.
     *
     * Called after every test case method.
     */
    protected void tearDown()
    {
    }

	public void teste_entra_1()
	{
		assertEquals("1", calculad1.entraUm());
	}

	public void testSoma_1_e_1()
	{
		assertEquals("1", calculad1.entraUm());
		assertEquals("1", calculad1.comandoSoma());
		assertEquals("1", calculad1.entraUm());
		assertEquals("2", calculad1.comandoSoma());
		assertEquals("1", calculad1.entraUm());
		assertEquals("11", calculad1.entraUm());
		assertEquals("13", calculad1.comandoSoma());
	}

	public void testSomar_11_e_1111()
	{
		assertEquals("1", calculad1.entraUm());
		assertEquals("11", calculad1.entraUm());
		assertEquals("11", calculad1.comandoSoma());
		assertEquals("1", calculad1.entraUm());
		assertEquals("11", calculad1.entraUm());
		assertEquals("111", calculad1.entraUm());
		assertEquals("1111", calculad1.entraUm());
		assertEquals("1122", calculad1.comandoSoma());
	}

	public void testSoma_0b1_0b1()
	{
		assertEquals("0", calculad1.limpa());
		calculad1.modoBin();
		assertEquals("0b1", calculad1.entraUm());
		assertEquals("0b1", calculad1.comandoSoma());
		calculad1.modoBin();
		assertEquals("0b1", calculad1.entraUm());
		assertEquals("0b10", calculad1.comandoSoma());
	}
}




